package maxDivScore;

public class Solution {
    public int maxDivScore(int[] nums, int[] divisors) {
        // 暴力
        int ans = divisors[0];
        int maxCount = 0;
        for (int div: divisors) {
            int c = 0;
            for (int num: nums) {
                if(num%div == 0) {
                    c++;
                }
                if(maxCount<c) {
                    ans = div;
                    maxCount = c;
                }else if(maxCount == c) {
                    ans = Math.max(ans,div);
                }
            }
        }
        return ans;
    }
}
